const {
	User,
	validateLogin
} = require('../../../model/User');

// 工具
const _ = require('lodash');

module.exports = async (req, res) => {
	req.session.destroy(err => {
		if (err == null) {
			res.clearCookie('connect-sid');
			res.json({
				message: '退出成功',
				code: 2000,
			});
		} else {
			res.json({
				message: '退出失败',
				code: 4000,
			});
		}
	});
};